package com.gf.nams.controller;

import net.sf.json.JSONObject;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.gf.nams.service.GfTestService;

import javax.annotation.Resource;

@Controller
@RequestMapping("/")
public class BaseController {
	
	private Logger logger = Logger.getLogger(BaseController.class);
	
	@Resource
	private GfTestService gfTestService;

	@RequestMapping("/")
	public ModelAndView index(){
		return new ModelAndView("index");
	}
	
	@RequestMapping("/test.do")
	@ResponseBody
	public String test(){	
		return "123123";
	}
	
	@RequestMapping("/haha")
	@ResponseBody
	public String haha(){	
		logger.info("haha");
		System.out.println("123123");
		return JSONObject.fromObject(gfTestService.getGftest()).toString();
	}
	
}
